import {defineStore} from "pinia";
import {getScheListByDepIdAndDate} from "@/api/schedule/index.ts";
type TState = {
    scheduleList:{
        [key:string]:{
            departmentId:string,
            doctorNum:number,
            isTimeout:boolean,
            reservation:number,
            sourceNum:number
        }
    }
}
const useScheduleStore = defineStore("Schedule",{
    state():TState{
        return {
            scheduleList:{

            }
        }
    },
    actions:{
        async getScheListByDepIdAndDateAsync(departmentId:string,year:number,month:number){
            const result = await getScheListByDepIdAndDate(departmentId,year,month);
            this.scheduleList = result.data;
        }
    }
})
export default useScheduleStore;